import io from '@hyoga/uni-socket.io';
import { HardInfoObj } from "./type/index";

const socket = io('http://127.0.0.1:7002', {
  query: {},
  transports: [ 'websocket', 'polling' ],
  timeout: 5000,
});

const hardInfoObj:HardInfoObj = {
	timer:null,
  detectionNum:0
};

const sendHartMessage = ()=>{
	socket.emit('send_hart_message');
}

socket.on('connect', () => {
  // socket.io 唯一连接id，可以监控这个id实现点对点通讯
  const { id } = socket;
  socket.on("watch_hart", () => {
  
  });
});

